package com.xxg.renrenproduct.component;

import com.xxg.renrencommon.domain.bean.CarryProductInfo;
import com.xxg.renrencommon.domain.bean.NewGoodsId;
import com.xxg.renrencommon.exception.ProductManagerException;
import com.xxg.renrenproduct.domain.query.GoodsInfo;

import java.util.List;

/**
 * 类说明
 *
 * @author szj
 * @date 2021/12/2
 */
public interface ProductComponent {
    /**
     * 根据商品id删除对应数据
     *
     * @param carryProductInfo
     */
    void deleteGoodsByGoodsId(CarryProductInfo carryProductInfo);

    /**
     * 复制商品到当前用户下
     *
     * @param userId      用户id
     * @param shopId      店铺id
     * @param spuId       当前商品id
     * @param categoryIds 目标分类
     * @param carryRatio  带货系数 费带货为null
     * @param info T类型实体
     * @return T
     */
    <T extends NewGoodsId> T copyGoodsToCurrentUserShop(Integer userId, Integer shopId, Integer spuId, List<Integer> categoryIds, Double carryRatio, T info);

    Integer insertProduct(GoodsInfo goodsInfo) throws ProductManagerException;

    void deleteGoodsByGoodsId(Integer ids);
}
